# -*- coding: utf-8 -*-

import os
import webapp2
from google.appengine.ext.webapp import template
from models import getRelevantInfo
# This controller handles the
# generation of the front page.
 
class MainHandler(webapp2.RequestHandler):
    
    def get(self):
 
        # We are using the template module to output the page.
        self.template_file = 'pop_up_templates.html'
 
        faculties = getRelevantInfo.getFacultiesAndDeparts()
 
        path = os.path.join(os.path.dirname(__file__), '../views' ,self.template_file)
        self.response.out.write(
 
            # The render method takes the path to a html template,
            # and a dictionary of key/value pairs that will be
            # embedded in the page.
            template.render( path,{
                "faculties" : faculties
        }))
